#ifndef BIN
#define BIN

#include <io\jpgstream.h>
#include <io\pngstream.h>
#include <base\vec2i.h>

#include <iostream>
#include <fstream>
#include <sstream>

class model;

class bin {

protected:

  unsigned char **rows;
  unsigned char **tile;
  
  model *p;
  
  pngstream *pngs;

  int row_count;
  
  int offset_x;
  int offset_y;
  
  int level;
  int lcoef;
  
  int chbpp;
  int colsize;
  int rowsize;
  int numtiles_x;

public:

  bin();
  virtual ~bin();
  virtual void init(model *parent, pngstream *_pngs, int level, int _offset_x, int _offset_y);
  virtual void addRow(unsigned char *row);
  virtual void generateTiles() = 0;
};

#endif